<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

</body>
<script>
  let parent = {
    name: "zhang",
    age: 20
  }
  let proxy = new Proxy(parent, {
    get(target, key) {
      console.log('getkey', key)
      return Reflect.get(target, key)
    },
    set(target, key, value) {
      console.log('setkey', key)
      return Reflect.set(target, key, value)
    }
  })

  class RefIml {
    constructor(rawValue) {
      this._value = rawValue
    }
    get value() {
      console.log('ref get')
      return this._value
    }
    set value(newValue) {
      console.log('ref set')
    }
  }

  const abc = new RefIml(proxy)
  console.log(abc.value.name)
  abc.value.age = 30
</script>

</html>